package utils
{
	import mx.collections.ArrayCollection;
	import mx.collections.ArrayList;

	public class ArrayListUtils
	{
		public function ArrayListUtils()
		{
		}
		
		/**
		 *  删除指定对象
		 **/
		public static function removeItem(list:ArrayCollection, item:Object):Boolean
		{
			var flag : int  = list.getItemIndex(item);
			if ( flag != -1 )
			{
				list.removeItemAt(flag);
				return true;
			}
			return false;
		}
		/**
		 *  查找ArrayList中是否存在对象
		 **/
		public static function containsValue(list:ArrayCollection, value:Object):Boolean
		{
			for each (var  item:Object in list )
			{
				if ( item == value ) {
					return true;
				}
			}
			return false;
		}
			
	}
}